The vtree website: https://nbarrowman.github.io/vtree
This presentation: https://nbarrowman.github.io/vtreeTutorial.html
https://www.frontiersin.org/articles/10.3389/fcomm.2021.789272/full
Data set is available at: https://zenodo.org/record/5779516
data <- read_spss("https://zenodo.org/record/5779516/files/Viral_Communication_Phase_I-III.sav")
d <- as_factor(data)agreement <- function(x,neutralAgree=TRUE,agree="Agree",disagree="Disagree") {
neutral <- if (neutralAgree) agree else disagree
case_when(
{{x}} == "Strongly Agree" ~ agree,
{{x}} == "Agree" ~ agree,
{{x}} == "Somewhat Agree" ~ agree,
{{x}} == "Neutral" ~ neutral,
{{x}} == "Somewhat Disagree" ~ disagree,
{{x}} == "Disagree" ~ disagree,
{{x}} == "Strongly Disagree" ~ disagree)
}d <- d %>%
mutate(
Phase_1=M_PHASE1_COMPETION,
Phase_2=M_PHASE2_COMPLETION,
Phase_3=M_PHASE3_COMPLETION,
politics_1=factor(case_when(
SD_POL_ORIENTATION == "Left" ~ "Left",
SD_POL_ORIENTATION == "-2" ~ "Left",
SD_POL_ORIENTATION == "-1" ~ "Left",
SD_POL_ORIENTATION == "Centre" ~ "Centre",
SD_POL_ORIENTATION == "1" ~ "Right",
SD_POL_ORIENTATION == "2" ~ "Right",
SD_POL_ORIENTATION == "Right" ~ "Right"),levels=c("Left","Centre","Right")),
mask_1=case_when(
PHASE1_AC_EFF_MASK == "Extremely effective" ~ "Effective",
PHASE1_AC_EFF_MASK == "Very effective" ~ "Effective",
PHASE1_AC_EFF_MASK == "Effective" ~ "Effective",
PHASE1_AC_EFF_MASK == "Somewhat effective" ~ "Less effective",
PHASE1_AC_EFF_MASK == "Not effective at all effective" ~ "Less effective"),
world_1=agreement(PHASE1_AS_WORLD,neutralAgree=TRUE),
science_eb_1=case_when(
PHASE1_AS_BOR_EXC == "Exciting" ~ "Exciting",
PHASE1_AS_BOR_EXC == "2" ~ "Exciting",
PHASE1_AS_BOR_EXC == "1" ~ "Exciting",
PHASE1_AS_BOR_EXC == "0" ~ "Not Exciting",
PHASE1_AS_BOR_EXC == "-1" ~ "Not Exciting",
PHASE1_AS_BOR_EXC == "-2" ~ "Not Exciting",
PHASE1_AS_BOR_EXC == "Boring" ~ "Not Exciting"),
harmless_1=agreement(PHASE1_RA_HARMLESS_r,neutralAgree=TRUE,
agree="Harmless",disagree="Not Harmless"),
finance_1=agreement(PHASE1_RA_FINANCE,neutralAgree=FALSE),
economy_1=agreement(PHASE1_RA_ECONOMY,neutralAgree=FALSE))| Some variables to try | |
|---|---|
science_eb_1 |
I think science is boring |
politics_1 |
Political orientation |
SD_GENDER |
Gender |
finance_1 |
I’m concerned about my financial situation |
economy_1 |
I’m concerned about damage to the economy |
harmless_1 |
I think Covid is harmless |